<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
 <div id="dialog-message">
 <form id="register_from_class">
	<input type="hidden" id="table_id" value="${param.table_id}">
	<input type="hidden" id="cpid" value="${param.cpid}">
	 <table> 
	 	<tr>
	 		<td width="50%">
	 		<fieldset>
				<label>名称：</label>
				<input type="text" id="cname" value="${param.name}"  require='true' name="cname" meth="notNull,isLength-2,notsm" maxlength="30"  title="名称不能为空,则名称不能小于三位,不能输入-特殊字符" />
				<span class="help-block">不为能空，不大于20个字符！</span> 
			</fieldset>
	 		</td> 
	 	</tr> 
	 	<tr id="addresss_1">
	 		<td width="50%">
	 		<fieldset>
				<label>地址：</label>
				<input type="text" id="addresss" value="${param.addresss}"  name="addresss" meth="" maxlength="30"  title="用户名称不能少于4位，由英文和数字组成" />
				<span class="help-block"></span> 
			</fieldset>
	 		</td> 
	 	</tr> 
	 	<tr>
	 		<td width="50%" id="cpassword_1">
	 		<fieldset>
				<label>班级默认密码：</label>
				<input type="text" id="cpassword" value="${param.cpassword}"   require='true' meth="notNull" name="cpassword"  maxlength="30"  title="班级密码不为空" />
				<span class="help-block">班级密码不为空</span> 
			</fieldset>
	 		</td> 
	 	</tr> 
	 </table>  
</form>	
</div>
<script type="text/javascript">
(function(){
	 
	function updateClass(contorl){
		var a =$("#register_from_class").hzValidate("init");  
		if(a==false){
			return;
		} 
		var object = OAajaxSubmit("register_from_class"); 
		 	//alert(obj2str(object));
			$.ajax({
			   type: "POST",
				url: "${pageContext.request.contextPath}/edu/sysClassAction.do?method=updateClass&r="+Math.random(),
				data: object,
				dataType:'json',
			   success: function(msg){ 
			    	if(msg.code=="1"){
			    		alert(msg.message); 
			    		$(contorl).dialog("close"); 
			    		window.class1.loadTree();
			    	}else{
			    		alert(msg.message);
			    	}
			   }
			}); 
	} 
	 $(function(){
		 var temp ="${param.type}";
		 if(temp<3){ 
			 $("#cpassword_1").remove();
		 } 
		 if(temp>3){
			 $("#addresss_1").remove();
		 }
		  
	 });
	window.classUpdate={};
	window.classUpdate.updateClass = updateClass;
})();
</script>
 